package com.woniu.dao.impl;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

import com.woniu.bean.Account;
import com.woniu.dao.AccountDao;
import com.woniu.utils.ConnectionUtils;

public class AccountDaoImpl  implements AccountDao{

	@Override
	public int saveAccount(Account a) throws SQLException {
		Connection conn = ConnectionUtils.getConnection();
		String sql ="insert into account(account_name,account_pwd) values(?,?);";
		PreparedStatement statement = conn.prepareStatement(sql);
		statement.setString(1, a.getAccountName());
		statement.setString(2, a.getAccountPwd());
		return statement.executeUpdate();
	}
	
}
